#dockerfile.haproxy

FROM haproxy:alpine

RUN date && \
    sed -i 's/dl.*org/mirrors.aliyun.com/g' /etc/apk/repositories && \
    echo "Asia/Shanghai" > /etc/timezone && \
    apk add --no-cache tzdata && \
    cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
    apk del tzdata && \
    mkdir -p /usr/share/zoneinfo/Asia && \
    cp /etc/localtime /usr/share/zoneinfo/Asia/Shanghai && \
    #haproxy config
    cd /opt && wget https://gitee.com/alivv/elvin-demo/raw/master/haproxy/run.haproxy.config.sh  && \
    sed -ir '2 ish /opt/run.haproxy.config.sh' /docker-entrypoint.sh

##############################
# #构建镜像

# docker build --no-cache -f dockerfile.haproxy.sh -t alivv/haproxy .
# #查看
# docker images alivv/haproxy

# docker push alivv/haproxy

##############################
#test

# docker rm -f ha
# docker run -dit --name ha alivv/haproxy

# docker ps -l
# docker logs ha

# docker exec -it ha sh
